<?php
/**
 * Created by PhpStorm.
 * User: Shen
 * Date: 2016/6/22
 * Time: 21:30
 */
$db_host = 'localhost';
$db_user = 'root';
$db_password = '123456';
$db_name = 'test';

$link = mysql_connect($db_host,$db_user,$db_password) or die(mysql_error());
mysql_selectdb($db_name,$link) or die(mysql_error());
mysql_query("set names 'utf8'") or die('编码设置错误');